package me.zingon.JRDeploy.ws;

import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.AbstractWebSocketHandler;

/**
 * Created by ZTC on 12/13/2016.
 */
public class LogWebSocket extends AbstractWebSocketHandler{
    @Override
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
        System.out.println(message.toString());
        System.out.println(message.getPayload());
        Thread.sleep(2000);
        session.sendMessage(new TextMessage(message.getPayload()+":hello"));
    }
}
